<!doctype html>
<html lang="{{ config('app.locale') }}">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, max-scale=1, min-scale=1,user-scalable=no">
  <meta name="_token" content="{{ csrf_token() }}"/>

  <link href="{{env('CDN_RESOURCE')}}/css/mobile/mobile1.css?v={{config('app.version')}}" rel="stylesheet"
        type="text/css">
  <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/1.1.2/weui.min.css">

  <title>Qkids久趣英语</title>

  @include('mobile.partial.wechatSign')
</head>
<body>

<div class="s-header">
  <div class="logo"></div>
  {{--@if($buyOption != 1 || $largeLimit['day'] === 0)--}}
  {{--<div id="switch-account" class="account white-btn " data-field="{{$recommendPlan}}">登录</div>--}}
  {{--@endif--}}
</div>


<div class="blue-bg">
  <div class="cover">
    <div class="b" style="font-family:MicrosoftYaHeiLight;font-weight: 200;">严选北美外教</div>
    <div class="m">在线授课</div>
    <div class="s">
      <span class="age">4-12</span>岁适用／精品小班低至<span class="age">35</span>元
    </div>


    <div style="position: relative">
      <img src="{{env('CDN_RESOURCE')}}/img/mobile/family.png">
      <div class="play-icon" id="viewVideo"></div>
    </div>

  </div>
  <div class="white-padding"></div>
</div>

<div class="wrapper">

  <div class="section" style="padding-top:0;">

    <div class="hot-offer" style="width: 300px;">
      <div class="left">
        <span class="sign">¥</span><span class="money">50</span>
      </div>

      <div class="right">
        @if($buyOption === 0 || $buyOption === 2)
          <div class="up" style="width: 100px;">优学派用户专享</div>
        @endif
        <div class="lesson-count">/{{$products[$recommendPlan]['duration']}}课时</div>
      </div>
    </div>

    <div class="apply-section">
      <div class="reg-btn apply-btn">
        优学派用户专享购买
      </div>
    </div>

    <div class="notice">
      @if($buyOption == 1 && $largeLimit['day'] > 0)
        <div class="text red">{{$largeLimit['next']}}开放购买</div>
      @else
        <div class="tag">
          <div>第{{$batch[$recommendPlan]}}期</div>
          <div></div>
          <div></div>

        </div>
        <div class="text">限量招募500人，还剩
          <span>{{empty($product[$recommendPlan]) ? 22 : $product[$recommendPlan]['left']}}</span> 人
        </div>
      @endif
    </div>

    <div class="features">
      <div class="item">
        <div class="graduation-icon icon"></div>
        <span>精选北美外教</span>
      </div>
      <div class="item">
        <div class="interest-icon icon"></div>
        <span>趣味教学场景</span>
      </div>
      <div class="item">
        <div class="level-icon icon"></div>
        <span>科学分级课程</span>
      </div>

      <div>
        <div class="connect-line"></div>
        <div class="connect-line"></div>
      </div>

    </div>
  </div>


  <div class="section">
    <div class="graduation-icon-c"></div>
    <div class="header">严选北美外教</div>
    <img src="{{env('CDN_RESOURCE')}}/img/mobile/teacher.png">
    <div class="statistic">
      <div class="item">
        <div class="up">1%</div>
        <div class="down">考核通过率</div>
      </div>

      <div class="item">
        <div class="up">100%</div>
        <div class="down">来自美国，加拿大</div>
      </div>

      <div class="item">
        <div class="up">95+</div>
        <div class="down">家长评分</div>
      </div>

    </div>
  </div>

  <div class="section">
    <div class="interest-icon-c"></div>
    <div class="header">趣味教学场景</div>
    <div class="sub-header">孩子到久趣的第一个转变—主动要求上课</div>
    <img src='{{env('CDN_RESOURCE')}}/img/mobile/teaching.png'>

    <div class="lesson-steps">
      <div class="item">
        <div class="photo-icon"></div>
        <div class="text">丰富动画</div>
      </div>


      <div class="item">
        <div class="game-icon"></div>
        <div class="text">游戏化</div>
      </div>


      <div class="item">
        <div class="thumbsup-icon"></div>
        <div class="text">同伴激励</div>
      </div>


    </div>
  </div>

  <div class="section">
    <div class="level-icon-c"></div>
    <div class="header">科学分级课程体系</div>
    <div class="sub-header">
      <span>基于欧洲语言共同框架(CEFR)独家研发，与中国公立小学新课标教材接轨，更适合中国孩子学习</span>
    </div>
    <img src="{{env('CDN_RESOURCE')}}/img/mobile/course_system.png" style="margin-top: 22px;">
    <div class="sub-header">
      <span>即刻连线北美外教，专业指导，进阶升级。</span>
      <span>久趣英语目前已开设自然拼读课、语言基础课，还有更多好学好玩的课程等你发现。</span>
    </div>
  </div>


  <div class="section ">
    <div class="blue-divider"></div>
    <div class="header">特惠价格，即刻报名</div>
    <div class="sub-header">180天无条件退款，报名后即可上课</div>

    <div class="lesson-plan">

      <div class="detail product4 zoom-out">

        <div class="fee">
                        <span class="up">
                            ¥ <span class="money">100</span>
                        </span>
          <span class="down">
                            /4 课时
                        </span>
        </div>

        <div class="schedule">
          <div><span>自购买起，一个月内有效</span></div>
          <div><span>建议4-6节课/周</span></div>
          <div><span>本期招生仅限前500</span></div>
          <div class="reg-btn buy-btn" data-field="4">购买</div>
        </div>

      </div>

      <div class=" detail zoom-in">

        <div class="fee">
                        <span class="up">
                            ¥ <span class="money">3500</span>
                        </span>
          <span class="down">
                            /100 课时
                        </span>
        </div>

        <div class="schedule">
          <div><span>自购买起，课时一年内有效</span></div>
          <div><span>建议4-6节课/周</span></div>
          @if($largeLimit['day'] > 0)
            <div class="reg-btn buy-btn disable" data-field="6">待开放</div>
          @else
            <div class="reg-btn buy-btn" data-field="6">购买</div>
          @endif
        </div>

      </div>

      <div class=" detail zoom-out">

        <div class="fee">
                        <span class="up">
                            ¥ <span class="money">1750</span>
                        </span>
          <span class="down">
                            /50 课时
                        </span>
        </div>

        <div class="schedule">
          <div><span>自购买起，课时90天内有效</span></div>
          <div><span>建议4-6节课/周</span></div>
          @if($largeLimit['day'] > 0)
            <div class="reg-btn buy-btn disable" data-field="5">待开放</div>
          @else
            <div class="reg-btn buy-btn" data-field="5">购买</div>
          @endif
        </div>

      </div>

    </div>
  </div>

  <div class="section">

    <div class="blue-divider"></div>
    <div class="header">简单<span>3</span>步，立即上课</div>

    <div class="lesson-steps" style="margin-top:10px;">
      <div class="item">
        <div class="ok-icon"></div>
        <span>购买课程</span>
      </div>

      <div class="item">
        <div class="chat-icon"></div>
        <span>微信约课</span>
      </div>

      <div class="item">
        <div class="tv-icon"></div>
        <span>进入教室</span>
      </div>
    </div>

    <div class="class-type">
      <div class="c-header">精品2、4人班，每节课30分钟</div>
      <div class="type">
        <div>
          <span>2</span>人班&nbsp<span>2</span>课时/节
        </div>

        <div><span>4</span>人班&nbsp<span>1</span>课时/节</div>

      </div>
    </div>
  </div>

  <div class="section">
    <div class="blue-divider"></div>
    <div class="header">家长说</div>
    <div class="review" id="review">
      <div class="left-r item ">
        <img src="{{env('CDN_RESOURCE')}}/img/mobile/avatar1.png"/>
        <div class="text">喜欢久趣，我们家一天一节课，孩子主动要求的。</div>

        <div class="review-who">
          <span>Mike 的家长</span>
        </div>
      </div>

      <div class="right-r item ">

        <div class="text">全程课小孩自己上完了，完全没让我帮忙。</div>
        <img src="{{env('CDN_RESOURCE')}}/img/mobile/avatar2.png"/>

        <div class="review-who">
          <span>Lorna 的家长</span>
        </div>
      </div>

      <div class="left-r item ">
        <img src="{{env('CDN_RESOURCE')}}/img/mobile/avatar3.png"/>
        <div class="text">现在上课已经成为了小朋友期盼的一件事，真不错！</div>

        <div class="review-who">
          <span>Steve 的家长</span>
        </div>
      </div>

      <div class="right-r item ">

        <div class="text">外教的语音语调都很好听，很地道。</div>
        <img src="{{env('CDN_RESOURCE')}}/img/mobile/avatar4.png"/>

        <div class="review-who">
          <span>Vincent 的家长</span>
        </div>
      </div>

      <div class="left-r item ">
        <img src="{{env('CDN_RESOURCE')}}/img/mobile/avatar5.png"/>
        <div class="text">孩子对语言很敏感，我希望他从小就接触纯正的表达。</div>

        <div class="review-who">
          <span>Alina 的家长</span>
        </div>
      </div>

    </div>

  </div>
</div>

{{--@include('mobile.partial.loginAndRegister')--}}

<div class="footer">

  <div class="icon-links">
    <div class="logo-blue"></div>
  </div>

  <div class="email">
    <div class="header">企业邮箱</div>
    <div class="text">service@qkids.cn</div>
  </div>

  <div class="qr-code">
    <img src="{{env('CDN_RESOURCE')}}/img/mobile/qrcode.png"/>
    <span>微信公众号</span>
    <span>久趣英语服务号</span>
  </div>

  <div id="account-info" style="text-align: center;display: none;margin-top: 10px;color: #676C75;font-size: 14px;">
    当前账号: <span id="current-account"></span> | <span id="switch-account">切换账号</span>
  </div>

  <div class="copy-right">
    <span>Copyright @2017-2018 Qkids All Rights Reserved</span>
    <span>闽ICP备12021838号-3</span>
  </div>

</div>

<div class="video-mask" id="videoMask">
  <div class="close-icon icon" id="closeVideo"></div>
  <div id="videoContainer" class="video">
  </div>
</div>

<div class="buy-restrict">
  <div class="info">
    您已购买过¥100元/4课时，每人仅限购买1次，如有需要，可报名长期课。
  </div>

  <a href="/wx/vip">
    <div class="small-btn confirm-btn">前往购买</div>
  </a>
</div>

<div id="redeem" class="redeem-mask">
  <div class="redeem-box">
    <form id="redeemForm" class="redeem-form">
      <div class="redeem-title">请输入优惠码</div>
      <input id="redeemNum" placeholder="卡号" type="tel">
      <input id="redeemCode" placeholder="密码" type="text">
      <div id="redeemBtn" class="submit-btn active" data-field="{{$campaignProduct}}">购买</div>
    </form>
  </div>
  <style>
    .redeem-mask {
      position: fixed;
      width: 100%;
      height: 100%;
      top: 0;
      background-color: rgba(0, 0, 0, 0.8);
      z-index: 1003;
      overflow: hidden;
      display: none;
      font-family: "VarelaRound-Regular", "PingFangSC-Light", "Microsoft YaHei";
    }

    .redeem-mask * {
      -webkit-box-sizing: border-box;
      box-sizing: border-box;
    }

    .redeem-mask .redeem-box {
      width: 78.667vw;
      margin: 35% auto;
      overflow: hidden;
      background-color: white;
      border-radius: 3.2vw;
      position: relative;
      padding: 0;
      content: 'viewport-units-buggyfill; width: 78.667vw; border-radius: 3.2vw';
    }

    .redeem-mask form {
      margin: 8.533vw auto;
      content: 'viewport-units-buggyfill; margin: 8.533vw auto';
    }

    .redeem-mask input {
      margin: 2.133vw auto 0 auto;
      display: block;
      width: 68vw;
      height: 12.267vw;
      line-height: normal;
      font-size: 3.733vw;
      font-family: VarelaRound-Regular;
      text-indent: 5.333vw;
      outline: none;
      color: #4b5058;
      background: white;
      border-radius: 6.133vw;
      border: 0.267vw solid #f2f2f2;
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
      content: 'viewport-units-buggyfill; margin: 2.133vw auto 0 auto; width: 68vw; height: 12.267vw; font-size: 3.733vw; text-indent: 5.333vw; border-radius: 6.133vw; border: 0.267vw solid #f2f2f2';
    }

    .redeem-mask input::-webkit-input-placeholder {
      font-weight: 300;
      font-family: PingFangSC-Light;
      color: #c1c1c1;
    }

    .redeem-mask input:-ms-input-placeholder {
      font-weight: 300;
      font-family: PingFangSC-Light;
      color: #c1c1c1;
    }

    .redeem-mask input::-ms-input-placeholder {
      font-weight: 300;
      font-family: PingFangSC-Light;
      color: #c1c1c1;
    }

    .redeem-mask input::placeholder {
      font-weight: 300;
      font-family: PingFangSC-Light;
      color: #c1c1c1;
    }

    .redeem-mask .redeem-title {
      height: 7.467vw;
      margin-bottom: 6.4vw;
      line-height: 7.467vw;
      font-size: 5.333vw;
      font-family: PingFangSC-Medium;
      color: #4b5058;
      text-align: center;
      content: 'viewport-units-buggyfill; height: 7.467vw; margin-bottom: 6.4vw; line-height: 7.467vw; font-size: 5.333vw';
    }

    .redeem-mask .submit-btn {
      display: block;
      margin: 2.133vw auto 0 auto;
      width: 68vw;
      height: 12.8vw;
      line-height: 12.8vw;
      background: rgba(153, 159, 168, 0.6);
      border-radius: 6.4vw;
      font-size: 4.267vw;
      font-family: PingFangSC-Medium;
      color: #e5e6e9;
      text-align: center;
      content: 'viewport-units-buggyfill; margin: 2.133vw auto 0 auto; width: 68vw; height: 12.8vw; line-height: 12.8vw; border-radius: 6.4vw; font-size: 4.267vw';
    }

    .redeem-mask .active {
      background: #32cdff;
      color: white;
    }
  </style>
</div>

<div id="alertBox" class="alert-box"></div>
<script type="text/javascript" src="https://res.wx.qq.com/open/libs/weuijs/1.1.2/weui.min.js"></script>

<!--引入微信js-SDK-->
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript" src="{{env('CDN_RESOURCE')}}/js/mobile/wx_config.js?v={{config('app.version')}}"></script>
<script type="text/javascript" src="https://static-app.97kid.com/wx/js/zepto.min.js"></script>
<script type="text/javascript" src="{{env('CDN_RESOURCE')}}/js/mobile/Zepto_fx_methods.js"></script>
<script type="text/javascript" src="{{env('CDN_RESOURCE')}}/js/mobile/login.js?v={{config('app.version')}}"></script>
<script type="text/javascript" src="{{env('CDN_RESOURCE')}}/js/mobile/utils1.js?v={{config('app.version')}}"></script>
<script type="text/javascript" src="{{env('CDN_RESOURCE')}}/js/AV.analytics.js"></script>


<script type="text/javascript">

  ;(function ($) {

    $(function () {
      window.wxconfig = new WxConfig(wechatConfig, '')
      window.account = new Account()
      account.forceLogin = true
      account.getUserInfo(function (err, user) {
        if (!err) {
          if (!user.isNewUser) {
            utils.alert({
              message: '您已经购买过体验课了不具备兑换资格',
              yesText: '购买其他课程',
              yes: function () {
                window.location.href = window.location.protocol + '//' + window.location.host + '/wx/vip'
              }
            })
            return
          }
          account.ajax({
            type: 'GET',
            path: '/s/yxp/check',
            success: function (data) {
              console.log('已绑定优学派设备')
            },
            error: function (err) {
              utils.alert({
                message: '您尚未绑定优学派设备不具备兑换资格',
                yesText: '去购买',
                yes: function () {
                  window.location.href = window.location.protocol + '//' + window.location.host + '/wx/'
                }
              })
              console.log('未绑定优学派设备')
              console.error(err)
            }
          })
        }
      })

      $('.apply-btn').off('click').on('click', function () {
        $('.redeem-mask').css('display', 'block')
      })
      $('#redeemBtn').off('click').on('click', function () {
        var productId = $(this).attr('data-field')
        account.ajax({
          type: 'POST',
          path: '/s/yxp/bind/redeem',
          data: {
            redeem: $('#redeemNum').val(),
            code: $('#redeemCode').val()
          },
          success: function (data) {
            console.log('优惠码绑定成功')

            console.log(productId)
            submitOrder(productId)
          },
          error: function (err) {
            utils.toast(err.message)
          }
        })
      })
      $('.buy-btn').off('click').on('click', function () {
        console.log($(this).attr('data-field'))
        submitOrder($(this).attr('data-field'))
      })
      $('.disable').off('click')

      {
        var totalPlans = 3
        var clickItem = null
        $('.lesson-plan .detail').on('click', function () {
          $(this).addClass('zoom-in').removeClass('zoom-out')
          $(this).siblings('div').each(function () {
            if ($(this).hasClass('zoom-in')) {
              $(this).removeClass('zoom-in').addClass('zoom-out')
            }
          })

          if ($(this).index() === (totalPlans - 1)) {
            clickItem = $('.lesson-plan .detail').eq(0)
            $('.lesson-plan .detail').eq(0).remove()
            $('.lesson-plan').append(clickItem)
          }

          if ($(this).index() === 0) {
            clickItem = $('.lesson-plan .detail').eq(totalPlans - 1)
            $('.lesson-plan .detail').eq(totalPlans - 1).remove()
            $('.lesson-plan').prepend(clickItem)
          }
        })
      }

      {
        function submitOrder (pId) {
          account.forceLogin = true
          //提交订单久趣后台
          account.getUserInfo(function (userInfoError, userInforesult) {

            if (userInfoError) {
              utils.toast(userInfoError.message)
            } else {
              account.ajax({
                type: 'POST',
                path: '/s/bills',
                data: {
                  productId: pId,
                  payChannel: utils.isWeChat() ? 'weixin' : 'alipay',
                  returnUrl: window.location.protocol + '//' + window.location.host + '/wx/verifypayment1/' + pId,
                  tradeType: 'JSAPI',
                  openId: window.localStorage.getItem(account.openId)
                },
                success: function (data) {
                  //唤起微信支付
                  if (data.status !== 'error') {
                    if (utils.isWeChat()) {
                      wxconfig.pay(data.bill_id, pId, JSON.parse(data.jsApiParameters))
                    } else {
                      window.location.href = data.url
                    }
                  } else {
                    utils.toast('下单失败，请重试')
                  }
                },
                error: function (err) {
                  if (pId == 1 && err.code === 'recharge.level.not.applicable.to.user') {
                    $('.buy-restrict').fadeIn()
                  } else {
                    utils.toast(err.message)
                  }
                }
              })

            }

          })
        }
      }

      {
        var timeout
        $(document).bind('scroll', function () {

          clearTimeout(timeout)
          timeout = setTimeout(function () {

            var reviewList = $('#review')
            if ($(window).scrollTop() > reviewList.offset().top - 300) {

              if (reviewList.css('visibility') === 'hidden') {
                reviewList.css('visibility', 'visible')
                reviewList.find('.item').each(function () {
                  $(this).addClass('fade-animate')
                })
              }
            }
          }, 10)
        })
      }
    })

  })(window.Zepto)


</script>
@include('mobile.partial.video', [
  'finishTime' => '110',
  'videoOption' => [
    'm3u8' => 'https://1251352844.vod2.myqcloud.com/45f5686avodtransgzp1251352844/3b4dc3f34564972818953227732/v.f20.mp4',
    'autoplay' => false,
    'coverpic' => '',
    'width' => '640',
    'height' => '380',
    'live' => false,
    'systemFullscreen' => true
  ]
])
</body>
</html>

